<?php
require_once("includes/forms.tbl.php");
require_once("viewinfo.php");

$id = $_REQUEST["id"];
if($id > 0)
{
	$pClsForms = new clsFormsTable($id);
	$title = $pClsForms->value('title');
	$content = $pClsForms->value('content');
	$attactment = $pClsForms->value('attach');
	$listforms = $pClsForms->listobj(10);
	$arr_link = array();
	foreach($listforms as $pClsForms)
	{
		if($pClsForms->value('id') != $id)
		{
			$arr_link[$pClsForms->value('title')] = "?page=forms&id=".$pClsForms->value('id');
		}
	}
	view_info_with_attach($title, $content, $attactment, "Các mẫu đơn khác", $arr_link );
}
else
{
	$title = "Các mẫu đơn";
	$pClsForms = new clsFormsTable();
	$listforms = $pClsForms->listobj(10);
	view_list_forms($title, $listforms);
}	
?>